import React from 'react'
import { RouteConfig } from '@/types/router'
import { wrapSuspense } from '@/router/lazyLoad'

let UserList = wrapSuspense(React.lazy(() => import('@/views/permissionManage/userManage/list')))
let RoleList = wrapSuspense(React.lazy(() => import('@/views/permissionManage/roleManage/list')))

const route: RouteConfig[] = [
  {
    path: 'permission',
    meta: {
      title: '权限管理',
      icon: 'Lock',
      permission: 'Permission',
      hidden: false
    },
    children: [
      {
        path: 'userList',
        element: <UserList />,
        meta: {
          title: '用户管理',
          hidden: false,
          permission: 'User',
        }
      },
      {
        path: 'addUser',
        element: <UserList />,
        meta: {
          title: '新增用户',
          hidden: true,
          permission: 'AddUser',
        }
      },
      {
        path: 'roleList',
        element: <RoleList />,
        meta: {
          title: '角色管理',
          hidden: false,
          permission: 'Role',
        }
      },
    ],
  },
]

export default route
